package cn.iocoder.yudao.module.pay.controller.app.wallet.vo.recharge;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.AssertTrue;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;

import java.util.List;
import java.util.Objects;

@Schema(description = "用户 APP - 创建钱包充值 Request VO")
@Data
public class AppPayWalletRechargeCreateReqVO {

    @Schema(description = "支付金额",  example = "1000")
    @Min(value = 1,  message = "支付金额必须大于零")
    private Integer payPrice;

    @Schema(description = "充值套餐编号", example = "1024")
    private Long packageId;
    
    @Schema(description = "钱包类型：0-人民币钱包，1-金料，2-金条，3-白银，4-铂金，5-钯金，6-积分", example = "0")
    private Integer walletType = 0; // 默认为人民币钱包
    
    @Schema(description = "支付凭证截图URL", example = "https://example.com/pay.jpg")
    @NotEmpty(message = "支付凭证不能为空")
    private List<String> payPicUrl;

    @Schema(description = "备注", example = "充值备注")
    private String remark;

    @AssertTrue(message = "充值金额和充钱套餐不能同时为空")
    public boolean isValidPayPriceAndPackageId() {
        return Objects.nonNull(payPrice) || Objects.nonNull(packageId);
    }

}
